{php include wl_template('common/header');}
<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="./index.php" method="get" class="form-horizontal" role="form">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="lexiangpingou" />
            <input type="hidden" name="do" value="goods" />
            <input type="hidden" name="ac" value="goods_code" />
            <input type="hidden" name="op" value="display" />
            <div class="form-group">

                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">项目名称</label>
                <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
                    <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}" placeholder="可模糊查询项目名称">
                </div>
                <div class="pull-right col-md-3">
                    <button class="btn btn-default min-width"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="table-responsive">
        <table class="table table-hover" >
            <thead>
            <tr>
                <th style="width:40px;">
                    <input type="checkbox" name="checkall" value="" id="checkall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});"/>
                </th>
                <th class="text-center" style="width:70px;">排序</th>
                <th style="width:80px;">项目图</th>
                <th style="width:180px;">项目名</th>
                <th class="text-center" style="width:140px;">分类</th>
                <th class="text-center" style="width:140px;">市场价</th>
                <th class="text-center" style="width:140px;">销量</th>
                <th></th>
                <th class="text-center" style="width:160px;">操作</th>
            </tr>
            </thead>
            <tbody>
            {php $i=0;}
            {loop $goodses $goods}



            <tr data-toggle="popover" data-trigger="hover" data-placement="left" class="js-goods-img" >
                <td><input type="checkbox" id="gid"  name="items[{php echo $i}]" value="{$goods['id']}" class="items" /></td>
                <td class="text-center"><input id="gorder" onchange="showUser(this.value,{$goods['id']})" type="text" class="form-control js-displayorder" value="{php echo $goods['displayorder'];}" data-id="{$goods['id']}"/> </td>
                <td><img class="scrollLoading" src="{IMAGE_PIXEL}" data-url="{php echo tomedia($goods['gimg'])}" onerror="this.src='{IMAGE_NOPIC_SMALL}'" height="50" width="70"/></td>
                <td class="line-feed" style="word-wrap:break-word;">
                    {$goods['gname']}


                    <!--<br />
                    <label data='{$goods['isnew']}' class='label label-default {if $goods['isnew']==1}label-info{else}{/if}' onclick="setProperty(this,{$goods['id']},'new')">{if $this->module['config']['tag1']}{php echo $this->module['config']['tag1'];}{else}上新{/if}</label>
                    <label data='{$goods['ishot']}' class='label label-default {if $goods['ishot']==1}label-info{/if}' onclick="setProperty(this,{$goods['id']},'hot')">{if $this->module['config']['tag2']}{php echo $this->module['config']['tag2'];}{else}疯抢{/if}</label>
                    <label data='{$goods['isrecommand']}' class='label label-default {if $goods['isrecommand']==1}label-info{/if}' onclick="setProperty(this,{$goods['id']},'recommand')">{if $this->module['config']['tag3']}{php echo $this->module['config']['tag3'];}{else}推荐{/if}</label>
                    <label data='{$goods['isdiscount']}' class='label label-default {if $goods['isdiscount']==1}label-info{/if}' onclick="setProperty(this,{$goods['id']},'discount')">{if $this->module['config']['tag4']}{php echo $this->module['config']['tag4'];}{else}优惠{/if}</label>-->
                </td>
                <td class="text-left" style="line-height:25px;text-align: center">
                    <span class="label label-warning" style="display: none">方式：{if $goods['selltype']==0}单买{else if $goods['selltype']==1}随意团{else if $goods['selltype']==2}邻购团{else if $goods['selltype']==3}自主团{else if $goods['selltype']==4}阶梯团{else if $goods['selltype']==5}抽奖团{else if $goods['selltype']==6}新专团{else if $goods['selltype']==7}订金团{/if}</span><br>
                    <span class="label label-info">{php echo cutstr($goods['typename'], 30, true);}</span>

                </td>
                <!--<td class="text-left" style="line-height:25px;">-->
                <!-- -->
                <!--<span class="label label-warning">起团人数：{$goods['groupnum']}人</span><br>-->
                <!--<span class="label label-info">团购时限：{$goods['endtime']}小时</span>-->
                <!-- -->
                <!--</td>-->
                <td class="text-left" style="line-height:25px;">
                    <span class="label label-warning">单价：￥{php echo number_format($goods['oprice'], 2)}</span><br>
                    <span class="label label-info">市场价：￥{php echo number_format($goods['mprice'], 2)}</span>
                </td>
                <td class="text-left" style="line-height:25px;">
                    <span class="label label-warning">库存：{$goods['gnum']}</span><br>
                    <span class="label label-info">销量：{$goods['salenum']}</span>

                </td>
                <td></td>
                <td class="text-center" style="position:relative;">
                    <a href="javascript:;" data-id="{$goods['id']}"  data-url="{php echo web_app_url('goods/detail',array('id'=>$goods['id']))}" id="js-copy{$goods['id']}" class="js-copy">复制链接</a><br>

                    <a href="javascript:;" class="js-goods-copy pull-right" goods-id="{$goods['id']}" >复制项目</a><br>
                    <a href="{php echo web_url('goods/goods', array('op' => 'post','id' => $goods['id']))}" class="">编辑</a>

                    {if intval($_GPC['status']) == 1}

                    - <a href="javascript:;" class="js-off-shelves-goods" goods-id="{$goods['id']}">下架</a>
                    {/if}
                    {if intval($_GPC['status']) == 2}
                    - <a href="javascript:;" class="js-on-shelves-goods" goods-id="{$goods['id']}">上架</a>
                    - <a href="javascript:;" class="js-delete-goods" goods-id="{$goods['id']}">删除</a>
                    {/if}
                    {if intval($_GPC['status']) == 4}
                    - <a href="javascript:;" class="js-on-shelves-goods" goods-id="{$goods['id']}">上架</a>
                    - <a href="javascript:;" class="js-remove-goods" goods-id="{$goods['id']}">彻底删除</a>
                    {/if}
                    <!--<a href="{php echo web_url('goods/goods', array('op' => 'sendnotice','id' => $goods['id'],'type'=>1))}" class="upjia" {if $goods['isupjia']==0} style="display:none" {/if}>上架通知</a> -->
                    <!--<a href="{php echo web_url('goods/goods', array('op' => 'sendnotice','id' => $goods['id'],'type'=>2))}" class="downjia"{if $goods['isdownjia']==0} style="display:none" {/if}>降价通知</a>-->
                </td>
            </tr>



            {php $i++;}
            {/loop}
            <tr>
                <td><input type="checkbox" name="checkall" value="" id="checkall" onclick="var ck = this.checked; $(':checkbox').each(function(){this.checked = ck});" /></td>
                <td colspan="8">
                    {if intval($_GPC['status']) != 2}
                    <a href="javascript:;" class="btn btn-success min-width js-batch js-off-shelves">下架</a>
                    {/if}
                    {if intval($_GPC['status']) != 1}
                    <a href="javascript:;" class="btn btn-primary min-width js-batch js-on-shelves">上架</a>
                    {/if}
                    {if intval($_GPC['status']) != 4}
                    <a href="javascript:;" class="btn btn-danger min-width js-batch js-delete">删除</a>
                    {/if}
                    {if intval($_GPC['status']) == 4}
                    <a href="javascript:;" class="btn btn-danger min-width js-batch js-remove">彻底删除</a>
                    {/if}
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script>
    $(function(){
        $(".scrollLoading").scrollLoading();
        $('.scrollLoading').hover(function(){
            var img = $(this).attr('src');
            var obj = this;
            var $pop = util.popover(obj, function($popover, obj){
                obj.$popover = $popover;
            }, '<div><img src="'+img+'" style="max-width:200px; max-height:200px;"></div>');
        }, function(){
            this.$popover.remove();
        });
    });
</script>
{php include wl_template('common/footer');}